      function query(carid){
      
          $("#carid").val(carid);
          $("#partsform").submit();
      }
	 
	   function updateStatus(id,status){
	    	  
	    	  jConfirm('确定要'+(status==1? '上':'下')+'架吗?', '操作确认', function(r) {
	    	  
		    	     if(r){
		    	     	  $.ajax({
						     type: 'get',
						     url: CONTEXT_PATH+'after/drawing/updateStatus', 
							 data:  {"status":status,"id":id},
							 dataType: 'json',
							 success: function(data) {  
				                if(data.result){
				                   reloadData();
				                }else{
				                	jAlert(data.msg,'提示');
				                }
			
				            }
							
						 });
		    	     }
	
			  });
	
	      
	   }
 
		function carFilter(){
			var dropBtnContent=$("#dropBtnContent");
			$("#dm-dropUl li").on("click",function(){
				var thisItem=$(this);
				var itemA=thisItem.find("a").text();
				dropBtnContent.text(itemA);
			});
		}
		
		function showDownloadDialog(programmeid,productid,modleid){
			
			 $("#dm-downloadModal").modal('show');
			 if(programmeid){
				 $("#dm-downloadModal #programmeFile").css('display','inline-block');
				 $("#dm-downloadModal #programmeFile").attr("href",FILESERVER_PATH_DOWN+"?id="+programmeid);
			 }else{
				 $("#dm-downloadModal #programmeFile").css('display','none');
			 }
			 if(productid){
				 $("#dm-downloadModal #productFile").css('display','inline-block');
				 $("#dm-downloadModal #productFile").attr("href",FILESERVER_PATH_DOWN+"?id="+productid);
			 }else{
				 $("#dm-downloadModal #productFile").css('display','none');
			 }
			 if(modleid){
				 $("#dm-downloadModal #modleFile").css('display','inline-block');
				 $("#dm-downloadModal #modleFile").attr("href",FILESERVER_PATH_DOWN+"?id="+modleid);
			 }else{
				 $("#dm-downloadModal #modleFile").css('display','none');
			 }
			
			
		}
		
		function showUploadDialog(partsid,programmeid,productid,modleid,
				programmename,productname,modlename){
 
			 $("#dm-uploadModal").modal('show');
			 $("#dm-uploadModal #partsid").val(partsid);
			 $("#dm-uploadModal #programmeid").val(programmeid);
			 $("#dm-uploadModal #productid").val(productid);
			 $("#dm-uploadModal #modleid").val(modleid);
			 
			 if(programmeid){
				 $("#dm-uploadModal #programmeSpan").html(programmename);
			 }else{
				 $("#dm-uploadModal #programmeSpan").html("请选择文件");
			 }
			 if(productid){
				 $("#dm-uploadModal #productSpan").html(productname);
			 }else{
				 $("#dm-uploadModal #productSpan").html("请选择文件");
			 }
			 if(modleid){
				 $("#dm-uploadModal #modleSpan").html(modlename);
			 }else{
				 $("#dm-uploadModal #modleSpan").html("请选择文件");
			 }
		}
		
		function upload(fileName,fileid){
			
			var file=$('#'+fileid+"File").val();
			   
			if(file==""){
			   jAlert("请选择一个附件!","提示");
          	   return;
          	}else {
          	 
          	    var fileType = file.substring(file.lastIndexOf(".")+1);
                 if(!(fileType && /^(jpg|JPG|png|PNG|gif|GIF|stp|STP)$/.test(fileType))){
                 	
                    $(".dm-modalHint").css('display','block');
                    return;
                    
                 }else{
     
                     $(".dm-modalHint").css('display','none');
                     $("#loading").showLoading(); 
				 	     $.ajax({
				             type: "post",
				             async:false,
				             url:FILESERVER_ID,
				             dataType: "jsonp",
				             jsonp: 'jsonpcallback',//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(一般默认为:callback)
				             jsonpCallback:"feedBackState",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名 
				             success: function(data){
				            	        
				            	        $("#dm-uploadModal #"+fileid+"id").val(data[0].id);
				            	        $.ajaxFileUpload
						                  (  
									           {  
									               url:FILESERVER_UPLOAD_PATH+'?origin=A3&userName='+ADMIN_PHONE+'&id='+data[0].id, 
									               secureuri:false,//一般设置为false  
									               fileElementId:fileid+"File",//文件上传空间的id属性  <input type="file" id="file" name="file" />  
									               dataType: 'jsonp',//返回值类型 一般设置为json  
									               jsonp: 'jsoncallback',  
									               success: function (data, status)  //服务器成功响应处理函数  
									               { 
									            	   data = $.parseJSON(data.replace(/<.*?>/ig,""));
									            	   $("#"+fileid+"Span").html(data.data.originName);
									            	   $('#loading').hideLoading();
									                
									               },  
									               error: function (data, status, e)//服务器响应失败处理函数  
									               {  
									            	    $('#loading').hideLoading();
									        
									               } 
									            }
									        )
						             },
				             error: function(){
				             }
				         });
                   }
		
		
		     } 
 
			
		}
		
		
	    window.onload = function(){
	         render(data);
	         carFilter(); //车型筛选
	    }
 